﻿using Inovout.Gis.Geometry;

namespace Inovout.Gis.Land
{
    public class TuBanGeometryFactory : GeometryFactory
    {
        public override IGeometryInfo Create(IGeometryInfo geometryInfo)
        {
            switch (geometryInfo.Layer.Name)
            {
                case "G31_H_PY":
                case "G32_H_PL":
                case "G33_H_PT":
                    return CreateTuBanGeometry(geometryInfo);
                default:
                    return null;

            }
        }
        private IGeometryInfo CreateTuBanGeometry(IGeometryInfo geometryInfo)
        {
            if (geometryInfo is ILineInfo)
            {
                return new TuBanLine(geometryInfo as ILineInfo);
            }
            else if(geometryInfo is IPointInfo)
            {
                return new TuBanPoint(geometryInfo as IPointInfo);
            }
            else if(geometryInfo is IPolygonInfo)
            {
                return new TuBanPolygon(geometryInfo as IPolygonInfo);
            }
            else
            {
                return null;
            }
        }
    }
}
